package com.tfjybj.msg.data.repository;

import com.tfjybj.msg.commons.entity.table.MessageEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;

/**
 * @Description:
 * @Author: xuziguo
 * @Date: 2021/4/19 下午 8:04
 * @Modified By:
 * @Modify Date:
 */


@Repository
public interface MessageRepository extends JpaRepository<MessageEntity, String> {

    @Transactional
    @Modifying
    @Query(value = "update MessageEntity set isDelete=1 where id=:id")
    int deleteMessage(@Param("id") String id);
}
